package com.qiaoyanqing.ximalaya.discovermodule.discover_adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.qiaoyanqing.ximalaya.discovermodule.discover_fragment.DiscoverRankSecondFragment;

import java.util.List;

/**
 * Created by 佳男 on 2016/12/5.
 */

public class DiscoverRankFragmentpagerAdapter extends FragmentPagerAdapter {
    private String [] list;
    private List<String> key;
    public DiscoverRankFragmentpagerAdapter(FragmentManager fm,  String []list,List<String>key) {
        super(fm);
        this.list=list;
        this.key=key;
    }
    @Override
    public Fragment getItem(int position) {
        return DiscoverRankSecondFragment.newInstance(list[position],key.get(position));
    }

    @Override
    public int getCount() {
        return list.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return list[position];
    }
}
